<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        div{
            width: 200px;
            height: 200px;
            background-color: red;
        }
    </style>
</head>
<body>
<div onmouseover="overfn()" onmouseout="outfn() "
onmousedown="downfn()" onmouseup="upfn()"
onmousemove="movefn()"
></div>
<input type="text" onkeydown="keydownfn()" onkeyup="keyupfn()" onblur="blurfn()">

<script>
    function movefn() {
        console.log("鼠标移动");
    }
    function downfn() {
        console.log("鼠标按下");
    }
    function upfn() {
        console.log("鼠标抬起");
    }
    function overfn() {
        console.log("鼠标移入");
    }
    function outfn() {
        console.log("鼠标移出");
    }

    //event.keyCode 按键编码 切换英文输入法测试
    function  keydownfn() {
        console.log("键盘按下："+event.keyCode);
    }
    function  keyupfn() {
        console.log("键盘抬起："+String.fromCharCode(event.keyCode));
    }

    function blurfn() {
        alert("编辑完成");
    }
</script>
</body>
</html>